package dq.pojo.view;

import java.util.Scanner;

public class LonginMenu {
    public  void  printLoginMenu() {
        int count=0;
        Scanner input = new Scanner(System.in);
        do {

            System.out.println("\t\t系统登录");
            System.out.println("------------------");
            System.out.println("请输入用户名");
            String uname = input.next();
            System.out.print("请输入密码");
            String upwd = input.next();
            if (uname.equals("admin") && upwd.equals("123456")) {
                count = 0;
                System.out.println("恭喜你登录成功！请继续操作下哦");
                break;
            } else {
                count++;
                System.out.println("登陆失败！你的用户明或密码错误！");
                if (count <= 2)
                    System.out.println("密码输入错误" + count + "还剩下" + (3 - count) + "次");
                else {
                    System.out.println("非法用户，即将退出系统");
                }
            }
        }
        while (count<3);
    }
}